package com.example.HeadFirstDemo.observe;

import com.example.HeadFirstDemo.observe.selfImpl.MessageData;
import com.example.HeadFirstDemo.observe.selfImpl.Observe;
import com.example.HeadFirstDemo.observe.selfImpl.ObserveDisplayFirst;
import com.example.HeadFirstDemo.observe.selfImpl.ObserveDisplaySecond;

public class TestCase {
    public static void main(String[] args){
        MessageData messageData=new MessageData();
        Observe observe=new ObserveDisplayFirst(messageData);
        Observe observe1=new ObserveDisplaySecond(messageData);
        //模拟修改数据。通知observe1和observe
        messageData.setMessage(1,"qc","chongqin");
    }
}
